<?php
class Sidebox extends AppModel {

    public $validate = array(
    'name'=>array('notEmpty'),
    'column'=>array('numeric'),
    'priority'=>array('rule'=>'numeric','message'=>'Insert valid number'),
    );

    public $order = array('Sidebox.priority desc');

    public function left_sideboxes() {
        return $this->findAll(array('column'=>1,'display'=>1),null,$this->order);
    }

    public function right_sideboxes() {
        return $this->findAll(array('column'=>3,'display'=>1),null,$this->order);
    }

    public function middle_sideboxes() {
        return $this->findAll(array('column'=>2,'display'=>1),null,$this->order);
    }
}
?>